-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature, n/a] updated dependencies #151
Conversation
tests all pass but Circle timed out for some reason |
Again, tests are passing but the final step is timing out. |
@davesag Thanks so much for combing through the code like this, lot's of good stuff in this PR. Reviewing.... |
lib/app.js
Outdated
// allow | ||
// const { coverage } = this.coverage; | ||
// ref rule: object-curly-newline | ||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Add that rule if you'd like. Sound's reasonable. Also this rewrite of makeKeysRelative
is nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the rule to "object-curly-newline": ["error", { "minProperties": 3 }],
package.json
Outdated
"shelljs": "^0.7.4", | ||
"sol-explore": "^1.6.2", | ||
"solidity-parser-sc": "0.4.1", | ||
"solparse": "^1.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solparse
is great - it's a more robust implementation than sc
and is very well maintained. And we have a friendly collaboration with them because we both helped with the upstream consensys parser.
That said, there are benefits to self-publishing sc
- for example it requires less coordination and we can often get away with much coarser parsing than they can - they're supporting a linter. If this was painful to maintain I would solparse
in a second but atm it's not and it's convenient to be able to quickly add the occasional over-permissive rule to stop solidity-coverage
from crashing.
Also we're actively trying to re-design ourselves around the solc
ast in #111 and #150.
Open to persuasion here but I'd rather not do this in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solidity-parser-sc
is terribly out of date dependency-wise vs solparser
(which I recently contributed some changes to). I think it makes sense to consolidate dependencies wherever possible. The alternative is fixing all the out of date dependencies in solidity-parser-sc
as well and effectively keeping them in sync. thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eminently reasonable. In fact we went through a long period of trying to unify under a single parser and solparse
is definitely the best thing out there right now. Thanks for contributing to it - fantastic.
On reflection, I'd rather preserve the flexibility/control that self-publishing provides since we're trying to move to a different AST and it's important to keep our parsing super consistent during that process so we know what behavior we're duplicating.
This change can't go in this PR, I'm really sorry. It's too consequential. I think it's ok for the time being if sc
has out-of-date deps, and we should revisit using solparse
if it looks like we'll be stuck in the current design for a while or the parser breaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cgewecke where is the repo for solidity-parser-sc
? If you are really wedded to that then I'd like to fix the dependencies.
topics: ['34b35f4b1a8c3eb2caa69f05fb5aadc827cedd2d8eb3bb3623b6c4bba3baec17'], | ||
// eslint-disable-next-line max-len | ||
data: '00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000003a2f55736572732f757365722f53697465732f73632d666f726b732f6d657461636f696e2f636f6e7472616374732f4d657461436f696e2e736f6c000000000000', | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you.
@@ -11,7 +11,7 @@ const coder = require('web3/lib/solidity/coder.js'); | |||
|
|||
// Don't use this address for anything, obviously! | |||
const secretKey = 'e81cb653c260ee12c72ec8750e6bfd8a4dc2c3d7e3ede68dd2f150d0a67263d8'; | |||
const accountAddress = new Buffer('7caf6f9bc8b3ba5c7824f934c826bd6dc38c8467', 'hex'); | |||
const accountAddress = Buffer.from('7caf6f9bc8b3ba5c7824f934c826bd6dc38c8467', 'hex'); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
package.json
Outdated
"request": "^2.81.0", | ||
"solc": "0.4.17", | ||
"truffle": "4.0.0-beta.2" | ||
"solc": "^0.4.17", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this pinned and change it when we explicitly decide to test above. Currently we check behavior above this point using the experimental pragma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
package.json
Outdated
"mocha": "^3.1.0", | ||
"ethereumjs-vm": "git+https://github.com/sc-forks/ethereumjs-vm-sc.git#6be86e6f12634b711423203e6744cafe07c38e69", | ||
"merkle-patricia-tree": "~2.2.0", | ||
"mocha": "^4.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bump this back down and see if that fixes the Circle hang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the Mocha change that fixes a lot of the dependency issues. The tests pass on CircleCI so I'm not sure why it would be the culprit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, yes and you're getting it to pass locally. I wonder what the difference is. Different Istanbul locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've worked it out. For CircleCI and Mocha4 need to pass in --exit
to the test command. Done that and now it exits properly without timing out.
package.json
Outdated
@@ -1,13 +1,17 @@ | |||
{ | |||
"name": "solidity-coverage", | |||
"version": "0.4.0", | |||
"version": "0.4.1", | |||
"description": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this at 0.4.0
and let npm do it when we run npm version patch
and publish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See parser upgrade notes below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@cgewecke Hi Christopher, I've pushed a number of changes based on your suggestions above. I'm open to fixing the dependency issues in Also I didn't downgrade Mocha as that's where a number of the dependency issues were coming from. As mentioned above I don't believe Mocha would be the reason CircleCI is timing out. It appears to be timing out on the connection to |
also worth noting I checked the full
|
@@ -33,7 +33,7 @@ | |||
"arraysInObjects": false | |||
}], | |||
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], | |||
"object-curly-newline": ["error", { "minProperties": 1 }], | |||
"object-curly-newline": ["error", { "minProperties": 3 }], | |||
"object-property-newline": ["error"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@area If you have a sec, could you give your opinion about this rule change? It reformats the code pretty extensively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind 😄. No, we don't have any of those tools set up. I suppose something like that might be useful though.
Yeah! That fixed it. |
Codecov Report
@@ Coverage Diff @@
## master #151 +/- ##
==========================================
+ Coverage 95.38% 95.61% +0.23%
==========================================
Files 6 6
Lines 368 365 -3
Branches 84 84
==========================================
- Hits 351 349 -2
+ Misses 17 16 -1
Continue to review full report at Codecov.
|
💩 test coverage dropped by |
😃 test coverage up by |
…run npm run lint -- --fix
Are you guys planning to merge this PR? It looks very useful as it updates lots of dependencies |
lib/parse.js
Outdated
const ASSERT = 'assert'; | ||
const IDENTIFIER = 'Identifier'; | ||
const EVENT_DEF = { type: 'eventDefinition' }; | ||
const LEFT_BRACE = '{'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
@cgewecke seeing as solidity-coverage is broken with Solidity v0.5.0, is there a migration path planned to merge this PR and migrate to solparse or solidity-antlr4 that would address these issues? See #258 for an example. |
@NoahZinsmeister Thanks for pinging - I will try to fix the calldata problem in #258 and the assembly issue in #287 ASAP. I'm not sure any of the JS parsers are fully 0.5.0 compliant at the moment unfortunately. |
Sure thing @cgewecke! Let me know if there's anything I can do to help :) |
Closing for house-keeping. |
I have upgraded a number of dependencies to remove most of the deprecation warnings.
--fix
option from the default lint command. (usenpm run lint -- --fix
to fix.)tested under Node 10.1 and Node LTS